
local ReadOnlyMap = {}
ReadOnlyMap.__cname = "util.ReadOnlyMap"
local ReadOnlyMapMt1 = {
    __index = ReadOnlyMap
}
ReadOnlyMap.__index = ReadOnlyMap
ReadOnlyMap.__newindex = function(tb, k, v)
    error("readOnly: not support")
end

local ClearTypeEnum = {
    Reset = nil,
    FillNil = 1,
}
ReadOnlyMap.ClearTypeEnum = ClearTypeEnum

function ReadOnlyMap.new(map)
    local obj = {}
    setmetatable(obj, ReadOnlyMapMt1)
    obj:ctor(map)
    setmetatable(obj, ReadOnlyMap)
    return obj
end

function ReadOnlyMap:ctor(map)
    assert(map.__cname == "util.Map")
    self.map = map
end

function ReadOnlyMap:Clear(clearType)
    self.map:Clear(clearType)
end

function ReadOnlyMap:GetCount()
    return self.map:GetCount()
end

function ReadOnlyMap:Add(k, v)
    error("readOnly: not support")
end

function ReadOnlyMap:Remove(k)
    error("readOnly: not support")
end

function ReadOnlyMap:Set(k, v)
    error("readOnly: not support")
end

function ReadOnlyMap:Get(k)
    return self.map:Get(k)
end

function ReadOnlyMap:ContainsKey(k)
    return self.map:ContainsKey(k)
end

function ReadOnlyMap:__tostring()
    return self.map:__tostring()
end

function ReadOnlyMap:GetEntrysIterator()
    return self.map:GetEntrysIterator()
end

function ReadOnlyMap:IsReadOnly()
    return true
end

return ReadOnlyMap
